﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Collections;
using Dictionary;

namespace Dictionary.BusLayer
{
    public class LibsContent
    {
        //Kiem tra thu muc
        public static void CheckDirLib()
        {
            DataLayer.FileDir.CheckDir();
        }

        public static ArrayList LoadNameDict()
        {
            ArrayList fLibs = DataLayer.FileDir.GetLibs();
            ArrayList lstName = new ArrayList();
            foreach (string s in fLibs)
            {
                lstName.Add(DataLayer.LoadData.NameDict(s));
            }
            return lstName;
        }

        //Load danh sach tu vung
        public static ArrayList LoadListWord(string fn)
        {
            return DataLayer.LoadData.ListWord(fn);
        }

        //Load danh sach dict
        public static ArrayList LoadFileName()
        {
            return DataLayer.FileDir.GetLibs();
        }

        //load noi dung
        public static ArrayList LoadContent(string fn,string word)
        {
            return DataLayer.LoadData.Content(fn, word);
        }

        //Kiem tra file anh ton tai
        public static bool CheckExistImage(string folder,string fn)
        {
            return DataLayer.FileDir.CheckFile(DataLayer.FileDir.dirImage + "\\" + folder+"\\" + fn);
        }

        //Tra ve duong dan cua thu muc Pics
        public static string GetDirImage()
        {
            return DataLayer.FileDir.dirImage;
        }
    }
}
